<div id="content">
	<%= render 'setting/tabs' %>
</div>

<h2>Search nationalities</h2>
<div class="form-search">
	<%= render 'search' %>
</div>

<h2>Listing nationalities</h2>
<table class="scaffold-table">
	<tr>
		<th>NO.</th>
		<th>Name</th>
		<th>View</th>
		<th>Edit</th>
		<th>Delete</th>
	</tr>

	<% @nationalities.each_with_index do |nationality,index| %>
	<tr>
		<td><%= index+1 %></td>
		<td><%= nationality.name %></td>
		<td class="command"> <% if can? :read, Nationality %>
		<%= link_to image_tag("view-icon.png", :border => 0) , nationality  %>
		<% else %>
		-
		<% end %> </td>
		<td class="command"> <% if can? :update, Nationality %>
		<%= link_to image_tag("edit-icon.png", :border => 0) , edit_nationality_path(nationality)  %>
		<% else %>
		-
		<% end %> </td>
		<td class="command"> <% if can? :destroy, Nationality %>
		<%= link_to image_tag("delete-icon.png", :border => 0) , nationality , :confirm => 'Are you sure?', :method => :delete %>
		<% else %>
		-
		<% end %> </td>
	</tr>
	<% end %>
</table>
<%= will_paginate @nationalities %>
<% if can? :create , Nationality %>
<%= link_to image_tag("add-icon.png", :border => 0) , new_nationality_path , {:class => 'form-command'} %>
<%= link_to 'New Nationality', new_nationality_path %>
<% end %>